#include <stdio.h>
#include <stdlib.h>
#include <string.h>


struct point 
{
  char *name;
  int coord[2];
};


int main(int argc, char *argcv[])
{

  struct point *P = malloc(sizeof(struct point));
  struct point *Q = malloc(sizeof(struct point));
  P->name = "DC";
  P->coord[0] = 20;
  P->coord[1] = 50;

  FILE *f;
  f = fopen("test.bin", "wb");
  
  fwrite(P, sizeof(struct point),1,f);
  fclose(f);

  char c[argc];

  f = fopen("test.bin","rb");
  fread(Q, sizeof(struct point),1 ,f);

  
  printf("%s\n%d\n%d\n", Q->name, Q->coord[0], Q->coord[1]);

  return 0;
}
